package com.newcoin.chat.service;

import com.newcoin.chat.beans.entity.FriendMsgEntity;
import com.newcoin.chat.beans.entity.GroupMsgEntity;

import java.util.List;

public interface ChatService {

    /**
     * 获取离线消息
     *
     * @param userId
     * @return
     * @throws Exception
     */
    List getOfflineMsg(long userId) throws Exception;

    /**
     * 添加朋友聊天信息
     *
     * @param friendMsgEntity
     * @throws Exception
     */
    void addFriendMsg(FriendMsgEntity friendMsgEntity) throws Exception;

    /**
     * 更新朋友发来未读的消息条数及最后一条的消息id
     *
     * @param userId
     * @param friendId
     * @param msgId
     * @throws Exception
     */
    void updateFriendLastMsfInfo(long userId, long friendId, long msgId,int num) throws Exception;

    /**
     * 获取群成员
     *
     * @param group
     * @return
     * @throws Exception
     */
    List<Long> getGroupMember(Long group) throws Exception;

    /**
     * 添加群聊天信息
     *
     * @param groupMsgEntity
     * @throws Exception
     */
    void addGroupMsg(GroupMsgEntity groupMsgEntity) throws Exception;

    /**
     * 更新群组发来不在线群员未读的消息条数及最后一条的消息id
     *
     * @param userId
     * @param groupId
     * @param msgId
     * @throws Exception
     */
    void updateGroupLastMsfInfo(long groupId, long userId, long msgId) throws Exception;
}
